<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <style>
    </style>
</head>
<body>
<div class="layui-container" style="width:100%;margin: auto;Text-align:center;">
    <form class="layui-form layui-form-pane" action="" lay-filter="">
        <div class="layui-form-item" style="font-size: 26px; color: #009688;"><br/>  修改密码<br/><br/><br/></div>
        <div class="layui-inline">
              <div class="layui-form-label">    原密码&nbsp;&nbsp;  </div>
            <div class="layui-input-block">
                <input type="password" name="oldPassword" placeholder="请输入原密码" class="layui-input" maxlength="20"style="width: 300px;">
            </div>
        </div><br/><br/>
        <div class="layui-input-inline" >
            <div class="layui-form-label" style="margin-left: 80px;">    新密码&nbsp;&nbsp;  </div>
            <div class="layui-input-inline">
                <input type="password" name="newPassword" placeholder="请输入新密码" class="layui-input" maxlength="20" style="width: 300px;">
            </div>
            <div class="layui-input-inline">
                6到16个字符
            </div>

         </div><br/><br/>

        <div class="layui-inline">
            <div class="layui-form-label">    确认新密码 &nbsp;&nbsp; </div>
            <div class="layui-input-block">
                <input type="password" name="newPassword2" placeholder="请重复输入密码" class="layui-input" maxlength="20"style="width: 300px;">
            </div>
            <div class="layui-inline">
            </div>
        </div><br/><br/>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn " style="width:200px; margin-right:50px;" lay-submit="" lay-filter="submit">确定</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script>
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let form = layui.form;
    $(function () {
        //监听提交
        form.on('submit(submit)', function (data) {
            console.log(data);
            CoreUtil.sendAjax("/sys/updateUserPassword", JSON.stringify(data.field), function (res) {
                layer.msg(res.msg);
            }, "PUT", false);
            return false;
        });
    });
</script>
</html>